<%@page import="com.wef.demo.entity.domain.SubjectDomain"%>
<%@page import="com.gfa4j.resource.ResourceManagerServer"%>
<%@page import="com.wef.common.util.CommonMessageDomain"%>
<%@page import="com.gfa4j.query.Field"%>
<%@ include file="/pages/common/taglib.jsp"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
		<title></title>
		<%@include file="/styles/css_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/css_lib.jsp"%>
		<link rel="stylesheet" type="text/css" href="${ctx}/pages/demo/demo.css" />
		
		<%@include file="/pages/common/js_global.jsp"%>
		<%@include file="/scripts/sdk/js_lib.jsp"%>
		<%@include file="/scripts/config/js_lib.jsp" %>
		<%@include file="/scripts/utils/js_lib.jsp"%>
		<%@include file="/scripts/i18n/js_lib.jsp"%>
		<%@include file="/scripts/format/js_lib.jsp"%>
		<%@include file="/scripts/validate/js_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/js_lib.jsp"%>
		<script type="text/javascript" src="${ctx}/pages/demo/demo.js"></script>
		<script type="text/javascript" src="./validator.js"></script>
		
		<script type="text/javascript">
			//App.pageCustomEnable = true;App.pageId = "jqgrid";
			$(window).ready(function(){
				$('div[accordion=true]').accordion({collapsible : true});
				$('div[tabGroup=true]').tabs();
				$('#pageLoadComplete').attr('isComplete',true);
			});
		</script>
	</head>
<body class="body">
	<!-- ------------------------------------------------------------------------------------------ -->
	<div class="Desc">
		功能:1.验证组件,扩展'pwdSecurity'验证方法,如下: (<a href="#" id="aDiv1">查看源码</a>)
	</div>
	<div id="div1" style="display: none;">
		<pre>
;(function ($) {
	$.extend($.jqValidator,{
		/**---------------------------------------------------------------------------pwdSecurity**/
		//密码强度规则 初始化
		init_pwdSecurity : function(validateRules){
			var $this = this; 
			$this.data($.jqValidator.validateMsgKey,
					$.extend({},$this.data($.jqValidator.validateMsgKey),
							{pwdSecurity:{msg:"",show:false}}
					)
				);
		},
		//密码强度校验
		pwdSecurity : function(validateRules){
			var $this = this;
			if($this.val().length > 0 && $this.val().length <= 3){
				$('#firstLevel').html('1级强度<img src="'+App.ctx+'/images/icon/del.gif"/>');
			}else{
				$('#firstLevel').html('');
			}
			
			if($this.val().length > 3 && $this.val().length <= 6){
				$('#secondLevel').html('2级强度<img src="'+App.ctx+'/images/icon/del.gif"/>');
			}else{
				$('#secondLevel').html('');
			}
			
			if($this.val().length > 6 && $this.val().length <= 9){
				$('#thirdLevel').html('3级强度<img src="'+App.ctx+'/images/icon/del.gif"/>');
			}else{
				$('#thirdLevel').html('');
			}
			return true;
		}
		/**---------------------------------------------------------------------------end pwdSecurity**/
		
	});
})(jQuery);
		</pre>
	</div>
	<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
		<form id="form1">
			<ul allowChange="true" class="edit_box">
				<li style="width: 100%;">
					<k:label text="密码强度" allowBlank="false"/>
					<k:password property="testPassword" styleId="editTestPassword" styleClass="text" validateRules="{pwdSecurity:true}"/>
					<span id="firstLevel"></span>
					<span id="secondLevel"></span>
					<span id="thirdLevel"></span>
				</li>
			</ul>
		</form>
	</div>
	<!-- ------------------------------------------------------------------------------------------ -->
	<div id="pageLoadComplete" isComplete="false" style="display: none;"></div>
</body>
</html>